package com.yimils.core.sys.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yimils.core.common.dto.GetQueryParams;
import com.yimils.core.common.dto.RspBase;
import com.yimils.core.sys.service.PartnerAgentService;
import com.yimils.core.sys.service.UserRoleService;
import com.yimils.core.sys.service.UserService;
import com.yimils.core.sys.vo.AgentDetailVo;
import com.yimils.core.sys.vo.PartnerSimVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 运营专员（合伙人代理）
 */
@RestController
public class PartnerAgentController {
    @Resource(name = "userService")
    private UserService userService;

    @Resource(name = "userRoleService")
    private UserRoleService userRoleService;

    @Resource(name = "partnerAgentService")
    private PartnerAgentService partnerAgentService;

    @GetMapping("/agent/partners")
    public RspBase getPartners(GetQueryParams queryParam) {
        RspBase rsp = RspBase.OK();
        IPage<PartnerSimVo> userList = partnerAgentService.getPartner(queryParam);
        rsp.put("data", userList);
        return rsp;
    }

    @GetMapping("/agent/details")
    public RspBase getDetails(GetQueryParams queryParam) {
        RspBase rsp = RspBase.OK();
        IPage<AgentDetailVo> userList = partnerAgentService.getDetails(queryParam);
        rsp.put("data", userList);
        return rsp;
    }
}

